package sh.grapendaal.tsuushin.module.uno.engine.domain.achievement.impl;

import sh.grapendaal.tsuushin.module.uno.engine.domain.Card;
import sh.grapendaal.tsuushin.module.uno.engine.domain.Playable;
import sh.grapendaal.tsuushin.module.uno.engine.domain.achievement.CommandAchievement;
import sh.grapendaal.tsuushin.module.uno.engine.event.CommandEvent;

public class LookAgainTheCardIsNowDiamondsAchievement extends CommandAchievement {

	@Override
	public String getName() {
		return "Look Again, The Card Is Now Diamonds";
	}

	@Override
	public String getDescription() {
		return "Try to play a card you don’t have.";
	}

	@Override
	public boolean isEarned(CommandEvent event) {
		return event.getType() == CommandEvent.Type.PLAY && event.getPlayed().getType() == Playable.Type.CARD
				&& !event.getPlayer().hasCard((Card) event.getPlayed());
	}

}